import java.util.Scanner;

public class Two {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		while (scan.hasNextLine()) {
			int sum = 0,a;
			String s1, s2;
			s1 = scan.nextLine();
			if(s1.indexOf('-')==-1){
				a = Integer.parseInt(s1);
			}
			//else a=-Integer.parseInt(s1);
			if (a < 10000 || a > 20000) {
				s1=s1.replace("-", "");
				for (int i = 0; i < s1.length(); i++) {
					s2 = s1.substring(i, i + 1);
					System.out.print(Integer.parseInt(s2) + " ");
					sum = sum + Integer.parseInt(s2);
				}
				System.out.println(sum);
			} else {
			    a=Integer.parseInt(s1.replace("-",""));
				System.out.print(Integer.toBinaryString(a) + ",");
				System.out.print(Integer.toOctalString(a) + ",");
				System.out.println(Integer.toHexString(a));
			}
		}
		scan.close();
	}
}
